$OpenBSD: patch-deps_npm_bin_node-gyp-bin_node-gyp,v 1.1 2012/06/28 08:30:28 jasper Exp $
--- deps/npm/bin/node-gyp-bin/node-gyp.orig	Mon Jun 25 16:15:51 2012
+++ deps/npm/bin/node-gyp-bin/node-gyp	Mon Jun 25 16:16:25 2012
@@ -1,2 +1,16 @@
 #!/usr/bin/env sh
-node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
+
+# dirname "$0" will have a different result when called internaly by node.
+
+DIR1=$( dirname "$0" )/../../node_modules/node-gyp/bin/node-gyp.js
+DIR2=$( dirname "$0" )/../lib/node_modules/node-gyp/bin/node-gyp.js
+
+if [ -e $DIR1 ]; then
+	node "$DIR1" "$@" 
+else
+	if [ -e $DIR2 ]; then
+		node "$DIR2" "$@" 
+	else 
+		echo "Can't find node-gyp.js!"
+	fi
+fi
